package com.swxy.club.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

/**
 * @author 易
 */

@Getter
public enum Gender implements CommonEnum{

    MALE("male", "男"),
    FEMALE("female", "女");


    @EnumValue
    private final String value;
    private final String description;

    Gender(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public static Gender fromValue(String value) {
        for (Gender gender : values()) {
            if (gender.value.equalsIgnoreCase(value)) {
                return gender;
            }
        }
        throw new IllegalArgumentException("无效的Gender值: " + value);
    }
}
